<template>
  <div class="home-banner">
  <!-- 轮播图 -->
  <!-- sliders: 控制轮播图需要渲染的数据 -->
  <!-- duration:如果要自动播放，每隔3秒钟会自动换一张图 -->
  <!-- autoplay: 控制轮播图是否自动播放 -->
    <XtxCarousel :slides="slides" :duration="3000" autoplay></XtxCarousel>
</div>
</template>
<script>
import { ref } from 'vue'
import { findBanner } from '@/api/home'
export default {
  name: 'HomeBanner',
  setup () {
    const slides = ref([])
    findBanner().then(res => {
      // console.log(res)
      slides.value = res.result
    })
    return {
      slides
    }
  }
}
</script>

<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  Left: 0;
  top: 0;
  z-index: 98;
  // background-color:pink;
  ::v-deep {
    .carousel-btn.prev {
      left: 270px!important;
    }
    .carousel-indicator {
      padding-left: 250px;
    }
  }
}
</style>
